<?php

	if ($activePetAttitude <= 10)
	{
		$activePetAttitude = "<font size=-1 color=red><b>ANGRY!</b></font>";
	}
	if (($activePetAttitude <= 30) AND ($activePetAttitude > 10))
	{
		$activePetAttitude = "<font size=-1 color=red>Sad</font>";
	}
	if (($activePetAttitude <= 60) AND ($activePetAttitude > 30))
	{
		$activePetAttitude = "<font size=-1 color=blue>Bored</font>";
	}
	if (($activePetAttitude <= 90) AND ($activePetAttitude > 60))
	{
		$activePetAttitude = "<font size=-1 color=green>Happy!</font>";
	}
	if ($activePetAttitude > 90)
	{
		$activePetAttitude = "<font size=-1 color=green>Extremely happy!</font>";
	}

	$activePetHunger = $hungerArray[$activePetHunger];

	if (($activePetHunger > 10) OR ($activePetHunger < 0)) { $activePetHunger = "Unknown 	($array[hunger])"; }

	$findDesign = fetch("SELECT * FROM custom_designs WHERE game = '$game'");

	$tableOutline = $findDesign[tableborder];
	$topAndBottomBG = $findDesign[top_cell_color];
	$topAndBottomText = $findDesign[top_cell_text];
	$middleBG = $findDesign[middle_cell_color];
	$middleTEXT = $findDesign[middle_cell_text];
	$reallyLight = $findDesign[really_light];
	$maintextColor = $findDesign[main_text_color];
	$mainlinkColor = $findDesign[main_link_color];
	$mainhoverColor = $findDesign[main_hover_color];
	$maincellColor = "#FFFFFF";

	$openHTML = $findDesign[openhtml];

	$closeHTML = $findDesign[closehtml];

	if (($getInfo[viewed_update] == 0) AND ($username))
	{
		$newupdateCheck = "<a href=$base_url/updates.pro.php?game=$game>News Update</a>";
	}

	$openHTML = eregi_replace("\(username\)", "$display_name", $openHTML);
	$openHTML = eregi_replace("\(timestamp\)", "$timestamp2", $openHTML);
	$openHTML = eregi_replace("\(datestamp\)", "$datestamp2", $openHTML);
	$openHTML = eregi_replace("\(points\)", "$points", $openHTML);
	$openHTML = eregi_replace("\(gamename\)", "$gameName2", $openHTML);
	$openHTML = eregi_replace("\(gameid\)", "$game", $openHTML);
	$openHTML = eregi_replace("\(hungerlevel\)", "$hungerLevel", $openHTML);
	$openHTML = eregi_replace("\(pagetitle\)", "$page_title", $openHTML);
	$openHTML = eregi_replace("\(pointsname\)", "$pointVar", $openHTML);
	$openHTML = eregi_replace("\(usersonline\)", "$countUsersOn", $openHTML);
	$openHTML = eregi_replace("\(tableborder\)", "$tableborder", $openHTML);
	$openHTML = eregi_replace("\(top_cell_color\)", "$top_cell_color", $openHTML);
	$openHTML = eregi_replace("\(top_cell_text\)", "$top_cell_text", $openHTML);
	$openHTML = eregi_replace("\(middle_cell_color\)", "$middle_cell_color", $openHTML);
	$openHTML = eregi_replace("\(middle_cell_text\)", "$middle_cell_text", $openHTML);
	$openHTML = eregi_replace("\(really_light_cell\)", "$really_light_cell", $openHTML);
	$openHTML = eregi_replace("\(main_text_color\)", "$main_text_color", $openHTML);
	$openHTML = eregi_replace("\(copywrite\)", "$copywrite", $openHTML);
	$openHTML = eregi_replace("\(baseurl\)", "$baseurl", $openHTML);
	$openHTML = eregi_replace("\(newupdate\)", "$newupdateCheck", $openHTML);
	$openHTML = eregi_replace("\(activepetID\)", "$activePetID", $openHTML);
	$openHTML = eregi_replace("\(activepet\)", "$activePetName", $openHTML);
	$openHTML = eregi_replace("\(activepetlvl\)", "$activePetLevel", $openHTML);
    $openHTML = eregi_replace("\(activepethappiness\)", "$activePetAttitude", $openHTML);
    $openHTML = eregi_replace("\(activepethunger\)", "$activePetHunger", $openHTML);
    $openHTML = eregi_replace("\(searchbox\)", "<FORM ACTION=\"http://www.whatever.com/games/prompt.pro.php?game=1\" METHOD=POST><INPUT TYPE=text NAME=command VALUE=\"\" SIZE=15>", $openHTML);
    $openHTML = eregi_replace("\(searchbutton\)", "<INPUT TYPE=submit NAME=Submit VALUE=\"Search\"></FORM>", $openHTML);

	if (!$getInfo2[real_name]) { $getInfo2[real_name] = "Unknown Name"; }
	$openHTML = eregi_replace("\(realname\)", "$pointVar", $openHTML);

	if ($getInfo2[gender] == 2) { $gender = "<font color=blue><b>Male</b></font>"; }
	if ($getInfo2[gender] == 1) { $gender = "<font color=#FF0099><b>Female</b></font>"; }
	if ($getInfo2[gender] == 0) { $gender = "Undecided"; }
	$openHTML = eregi_replace("\(gender\)", "$gender", $openHTML);

	smilies($openHTML);

	$closeHTML = eregi_replace("\(username\)", "$display_name", $closeHTML);
	$closeHTML = eregi_replace("\(timestamp\)", "$timestamp2", $closeHTML);
	$closeHTML = eregi_replace("\(datestamp\)", "$datestamp2", $closeHTML);
	$closeHTML = eregi_replace("\(points\)", "$points", $closeHTML);
	$closeHTML = eregi_replace("\(gamename\)", "$gameName2", $closeHTML);
	$closeHTML = eregi_replace("\(gameid\)", "$game", $closeHTML);
	$closeHTML = eregi_replace("\(hungerlevel\)", "$hungerLevel", $closeHTML);
	$closeHTML = eregi_replace("\(pagetitle\)", "$page_title", $closeHTML);
	$closeHTML = eregi_replace("\(pointsname\)", "$pointVar", $closeHTML);
	$closeHTML = eregi_replace("\(usersonline\)", "$countUsersOn", $closeHTML);
	$closeHTML = eregi_replace("\(tableborder\)", "$tableborder", $closeHTML);
	$closeHTML = eregi_replace("\(top_cell_color\)", "$top_cell_color", $closeHTML);
	$closeHTML = eregi_replace("\(top_cell_text\)", "$top_cell_text", $closeHTML);
	$closeHTML = eregi_replace("\(middle_cell_color\)", "$middle_cell_color", $closeHTML);
	$closeHTML = eregi_replace("\(middle_cell_text\)", "$middle_cell_text", $closeHTML);
	$closeHTML = eregi_replace("\(really_light_cell\)", "$really_light_cell", $closeHTML);
	$closeHTML = eregi_replace("\(main_text_color\)", "$main_text_color", $closeHTML);
	$closeHTML = eregi_replace("\(copywrite\)", "$copywrite", $closeHTML);
	$closeHTML = eregi_replace("\(baseurl\)", "$baseurl", $closeHTML);
	$closeHTML = eregi_replace("\(activepetID\)", "$activePetID", $closeHTML);
	$closeHTML = eregi_replace("\(activepet\)", "$activePetName", $closeHTML);
	$closeHTML = eregi_replace("\(activepetlvl\)", "$activePetLevel", $closeHTML);
	$closeHTML = eregi_replace("\(activepethappiness\)", "$activePetAttitude", $closeHTML);
    $closeHTML = eregi_replace("\(activepethunger\)", "$activePetHunger", $closeHTML);
    $closeHTML = eregi_replace("\(searchbox\)", "<FORM ACTION=\http://www.whatever.com/games/prompt.pro.php?game=1\" METHOD=POST><INPUT TYPE=text NAME=command VALUE=\"\" SIZE=15>", $closeHTML);
    $closeHTML = eregi_replace("\(searchbutton\)", "<INPUT TYPE=submit NAME=Submit VALUE=\"Search\"></FORM>", $closeHTML);

	if (!$getInfo2[real_name]) { $getInfo2[real_name] = "Unknown Name"; }
	$closeHTML = eregi_replace("\(realname\)", "$pointVar", $closeHTML);

	if ($getInfo2[gender] == 2) { $gender = "<font color=blue><b>Male</b></font>"; }
	if ($getInfo2[gender] == 1) { $gender = "<font color=#FF0099><b>Female</b></font>"; }
	if ($getInfo2[gender] == 0) { $gender = "Undecided"; }
	$closeHTML = eregi_replace("\(gender\)", "$gender", $closeHTML);

	smilies($closeHTML);

?>
